package systemService

import (
	"CommonsProject/models/systemModel"
	"CommonsProject/pkg/tools/sqlTool"
	"CommonsProject/repository/systemRepository"
)

type SysUserService struct {
	Repository *systemRepository.SysUserRepository
}

// AddSysUser 添加用户
func (service *SysUserService) AddSysUser(user *systemModel.SysUser) {
	service.Repository.AddSysUser(user)
}

// RemoveSysUser 删除用户
func (service *SysUserService) RemoveSysUser(id int) {
	service.Repository.RemoveSysUser(id)
}

// ModifySysUser 修改用户
func (service *SysUserService) ModifySysUser(user *systemModel.SysUser) {
	service.Repository.ModifySysUser(user)
}

// GetSysUserById 查询用户通过ID
func (service *SysUserService) GetSysUserById(id int) *systemModel.SysUser {
	return service.Repository.FindSysUserById(uint(id))
}

// GetSysUserList 查询用户
func (service *SysUserService) GetSysUserList(user *systemModel.SysUser, pageNum, pageSize int) sqlTool.PageInfo {
	return service.Repository.FindSysUser(user, pageNum, pageSize)
}
